<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="format-detection" content="telephone=no"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>修改密码</title>
    <link rel="stylesheet" href="../../js/mui/css/mui.min.css">
    <link rel="stylesheet" href="../../css/mui-app-style.css">
    <style>
    </style>
</head>
<body>
<header class="mui-bar mui-bar-nav">
    <a class="mui-action-back mui-icon mui-icon-back mui-pull-left"></a>
    <h1 class="mui-title"><!--修改密码--></h1>
</header>
<div class="mui-content">
    <form class="mui-input-group">
        <div class="mui-input-row">
            <label>旧密码</label>
            <input type="text" id="old" placeholder="请输入旧密码">
        </div>
        <div class="mui-input-row">
            <label>新密码</label>
            <input type="text" id="new" class="mui-input-clear" placeholder="请输入新密码">
        </div>
        <div class="mui-input-row">
            <label>确认密码</label>
            <input type="text" id="confirm" class="mui-input-clear" placeholder="请再次输入新密码">
        </div>
    </form>
    <div class="mui-row">
        <div class="mui-button-forms">
            <button id="submit" type="button" data-loading-text = "提交中" class="mui-btn mui-btn-primary mui-btn-block">提交</button>
            <!--<button id="submit" type="button" data-loading-text = "提交中"  class="mui-btn mui-btn-primary mui-btn-block" data-loading-icon="mui-spinner mui-spinner-custom">确认</button>-->
        </div>
    </div>
</div>
<script src="../../js/mui-layer-mobile/layer.js"></script>
<script src="../../js/mui/js/mui.min.js"></script>
<script src="../../js/common/crypto-js.js"></script>
<script src="../../js/common/common.js"></script>
<script>
mui.ready(function () {

    mui(".mui-button-forms").on("tap","#submit",function () {
        mui(this).button('loading');
        var old = mui("#old")[0].value;
        var new1 = mui("#new")[0].value;
        var confirm = mui("#confirm")[0].value;
        if(!old){
            mui.alert("请输入旧密码"); return;
        }
        if(new1.length<6){
            mui.alert("新密码请至少输入6位"); return;
        }

        if(new1!=confirm){
            mui.alert("新密码和确认密码不一致"); return;
        }

        //提示
        layer.open({
            content: '修改成功'
            ,skin: 'msg'
            ,time: 2 //2秒后自动关闭
        });
        setTimeout(()=>{
            location.href="../login/login.html";
        },2000)
    })
})
</script>
</body>
</html>